package com.data.JVM;

import java.util.ArrayList;
import java.util.List;

/**  虚拟机参数 -verbose:gc -Xms20M -Xmx20M  -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8  -XX:+HeapDumpOnOutOfMemoryError
 * 测试堆栈溢出
 * Created by wangbing on 2018/5/31.
 */
public class HeapOOM {
    static class OOMObject {

    }

    public static void main(String[] args) {
        List<OOMObject> list = new ArrayList<OOMObject>();
        while (true){
            list.add(new OOMObject());
        }
    }
}
